package com.listar.systemdemo.controller;

import com.listar.systemdemo.dao.UserDao;
import com.listar.systemdemo.entity.UserEntity;
import com.listar.systemdemo.service.UserService;
import com.listar.systemdemo.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Map;

import static net.sf.jsqlparser.util.validation.metadata.NamedObject.user;


@RestController
@RequestMapping("/booking/user")
public class UserController {
    
    @Autowired
    private UserService userService;
    
    @Autowired
    private UserDao userDao;
    
    /**
     * 获取用户信息
     */
    @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
    public R info(@PathVariable("id") Long id) {
//        UserEntity user = userService.getById(id);
        UserEntity user = userDao.selectById(id);
        return R.ok().put("user", user);
    }
}
